<%@ page language="java" import="java.util.*" contentType="text/html;charset=utf-8"%> 
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<h2 class="contentTitle">新增多项选择题题目</h2>
<script type="text/javascript" >
 	function valtkname(a){
 		var val=a.value;
 		$("#tkname2").val($(a).find("option:selected").text());
 	}
 	function checks(a){
 		var ids=new Array();
 		if($("input[name='zqs']:checked").size()<2){
 			alert("请选择多个答案！");
 			return false;
 		}
 		$("input[name='zqs']:checked").each(function(i,obj){
 			ids[i]=$(obj).val();
 		});
 		var idStr=ids.join("");
 		$("#zq").val(idStr);
 		return iframeCallback(a, navTabAjaxDone);
 	}
</script> 
<form action="<c:url value='tmcurd.do?method=addsave'/>"  method="post" class='required-validate pageForm' onsubmit="return checks(this)">
<input type="hidden" name="id" value="${tm.id}" />
<input type="hidden" name="tkname" id="tkname2"/>
<input type="hidden" name="tmtype" value="2"/>
<input type="hidden" name="zq" id="zq" />
<div class="pageFormContent" layoutH="97">
	<div class="unit">
		<div class="unit">
		<label>题目属于哪个科目</label>
		
		<select class="required" name="tkid"  onchange="valtkname(this)">
			<option value="" selected="selected" >--请选择 科目--</option>
			<c:forEach var="item" items="${tks}">
				<option value="${item.id}" ${tm.tkid eq item.id ? 'selected="selected"':''} >${item.title}</option>
			</c:forEach>
		</select>
	</div>
	</div>
	<div class="unit">
		<div class="unit">
		<label>题目内容</label>
		<textarea class="editor required" name="tm" rows="10" cols="80" tools="simple">${tm.tm}</textarea>
	</div>
	</div>
	<div class="unit">
		<label>选项A</label>
		<input type="checkbox" name="zqs" value="A"/><br/>
		<input type="text" name="d1" value="${tm.d1}" class="textInput required" maxlength="200" size="100"/>
	</div>
	<div class="unit">
		<label>选项B</label>
		<input type="checkbox" name="zqs" value="B"/><br/>
		<input type="text" name="d2" value="${tm.d2}" class="textInput required" maxlength="200" size="100"/>
	</div>
	<div class="unit">
		<label>选项C</label>
		<input type="checkbox" name="zqs" value="C"/><br/>
		<input type="text" name="d3"  value="${tm.d3}" class="textInput required" maxlength="200" size="100"/>
	</div>
	<div class="unit">
		<label>选项D</label>
		<input type="checkbox" name="zqs" value="D"/><br/>
		<input type="text" name="d4" value="${tm.d4}" class="textInput required" maxlength="200" size="100"/>
	</div>
	<div class="unit">
		<label>正确答案</label>
		<input type="text" placeholder="选择上面的选项,答案在提交时自动填入." readonly="readonly" value="${tm.zq}" class="textInput" maxlength="200" size="100"/>
	</div>
	<div class="unit">
		<label>题目分数</label>
		<input type="text"  name="fs" value="${tm.fs}" class="textInput required digits" maxlength="200" size="100"/>
	</div>
	
</div>
<div class="formBar">
	<ul>
		<li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li>
		<li><div class="buttonActive"><div class="buttonContent"><button type="reset">继续新增下一个</button></div></div></li>
		<li><div class="button"><div class="buttonContent"><button type="button" class="close">关闭</button></div></div></li>
	</ul>
</div>
</form>